/**
 * 
 */
package com.et114.modules.content.dao;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.components.simpletable.dao.SimpleTableDAOImpl;
import com.et114.modules.content.vo.CommonType;

/*
 * @author guanhw
 */
public class CommonTypeDao extends SimpleTableDAOImpl {
	
	public DataList getCommonTypes( CommonType commonType ) throws Exception {
		return queryListDataList ( commonType , "getCommonTypes"  ) ;
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< CommonType > getRootCommonTypes( CommonType commonType ) throws Exception { 
		return queryList( commonType , "getRootCommonTypes" ) ;
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< CommonType > getRootCommonTypesCacheModel( CommonType commonType ) throws Exception {  
		return queryList( commonType , "getRootCommonTypesCacheModel" ) ; 
	}
	
	
	
	public CommonType getCommonTypeById( Long id ) throws Exception {
		return ( CommonType ) load( id , "getCommonTypeById" ) ; 
	}
	
	public Long saveCommonType( CommonType commonType ) throws Exception {
		return ( Long  ) insert( commonType , "insertCommonType" ) ;
	}
	
	public void updateCommonType( CommonType commonType ) throws Exception {
		update(  commonType , "updateCommonType" ) ; 
	}
	
	public void removeCommonType( Long id ) throws Exception {
		delete ( id , "removeCommonType" ) ;
	}
}
